package com.example.demo.controller;

import com.example.demo.config.ConfirmConfig;
import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author chensixiang chensixiang1234@gmail.com
 */
@Component
@Slf4j
public class Consumer {

    @RabbitListener(queues = ConfirmConfig.CONFIRM_QUEUE_NAME)
    public void get(Message message, Channel channel) {
        log.info("收到队列的消息为 -> "  + new String(message.getBody()));
    }
}
